package com.dao.OrderForm;

import com.entry.OrderForm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrderFormMapper {
    public int addOrderForm(@Param("order_code") String order_code,
                            @Param("order_addres") String order_addres,
                            @Param("order_receiver") String order_receiver,
                            @Param("mobile") String mobile,
                            @Param("create_date") Date create_date,
                            @Param("user_id") int user_id,
                            @Param("status") int status,
                            @Param("body") String body,
                            @Param("total_amount") int total_amount,
                            @Param("subject") String subject);
    public int addAllOrderForm(@Param("order_code") String order_code,
                            @Param("order_addres") String order_addres,
                            @Param("order_posts") int order_posts,
                            @Param("order_receiver") String order_receiver,
                            @Param("mobile") String mobile,
                            @Param("user_message") String user_message,
                            @Param("create_date") Date create_date,
                            @Param("pay_date") Date pay_date,
                            @Param("delivery_date") Date delivery_date,
                            @Param("user_id") int user_id,
                            @Param("confirm_date") Date confirm_date,
                            @Param("status") int status,
                            @Param("body") String body,
                            @Param("total_amount") int total_amount,
                            @Param("subject") String subject);

    public OrderForm getOrderFormByOrderCode(String order_code);

    public List<OrderForm> getOrderSell(int user_id);
    //查询交易订单状态
    public List<OrderForm> getOrderSellandStatus(@Param("user_id") int user_id,@Param("status") int status);

    //更新商品状态
    public int updateOrderStatus(@Param("status") int status,@Param("order_code") String order_code);

    //删除订单
    public int deleteOrderForm(@Param("order_code") String order_code);

    //更新状态以及支付时间pay_date
    public int modifyOrderStatus_pay_date(@Param("status") int status,@Param("pay_date") Date pay_date,@Param("order_code") String order_code);

    //更新状态以及确认时间confirm_date
    public int modifyOrderStatus_confirm_date(@Param("status") int status, @Param("confirm_date") Date confirm_date, @Param("order_code") String order_code);

}
